function rest=findindex(alpha,target)

tmp=1:size(alpha,1);
rest=zeros(size(target'));
for ii=1:size(alpha,1)
    rest(ii)=find(alpha(tmp,ii)==target(ii));
end
if (size(unique(rest,'rows'),1)==1)
    rest=rest(1);
else 
    rest=0;
end
